<?php
/*error_reporting(E_ALL);
 ini_set("display_errors", 1);
	require_once("Manager.php");
	
	$manager = new Manager;
	$manager->start();

	if($manager->isLoggedIn()){*/

	require_once 'config.php';
	require_once 'php/Session.php';
	$session = new Session();

	if($session->isStarted()){
		require_once 'php/User.php';
		$user = new User($session->getData('id'));

?>
<html>
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

		<link rel="stylesheet" type="text/css" href="css/lobby.css">
		<link rel="stylesheet" type="text/css" href="css/global.css">

		<title>Debatepapo 2.0</title>

		<script src='js/tools.js'></script>
		<script src='js/main.js'></script>
		<script src='js/lobby.js'></script>
		<script src='js/Group.js'></script>
		<script src='js/Room.js'></script>
		<script src='js/Global.js'></script>
		<script src='js/Communicator.js'></script>
		<script src='js/User.js'></script>
		<script src='js/Me.js'></script>
		<script>
			var globalGroupRoom = '<?php $user->resolveGroupRooms(); ?>';
		</script>
	</head>
	<body onload='loadPage()'>
		<?php $session->placeLogout(); ?>

		<section id='toolbar'>
			<div class='toolbarArea'>
				<div class='area'>
					<div class='menu'>
						<button class='leaveApp' onClick='logout();'><p>Deslogar</p></button>
					</div>
				</div>
			</div>
		</section>

		<section id='content'>

			<header class='top'></header>

			<div class='area'>

				<div class='right'>

					<div id='roomsList'>

						<section id='otherGroups'>

							<header>
								<p class='title'>Salas Abertas</p>
							</header>

							<div class='list'></div>

						</section>

						<section id='ownedGroups'>

							<header>
								<p class='title'>Suas salas</p>
							</header>

							<div class='list'></div>

						</section>

					</div>

				</div>

			</div>
		</section>
	</body>
</html>
<?php
	}else header('Location: index.php');
?>